home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Online / AmTalk / Rexx / talk < prev    next >
Text File  |  1996-12-30  |  2KB  |  75 lines

  1. /* AmTalk Starter                          */
  2. /* usage:                                  */
  3. /* talk.rexx user@host locate/s remotetty  */
  4. /* $VER: AmTalk.rexx 0.7 (11.10.96)        */
  5.  
  6.  
  7. options results
  8.  
  9. parse arg username locate remotetty
  10. parse var username user '@' host
  11.  
  12. if ~show(l, "rexxsupport.library") then
  13.     if ~addlib("rexxsupport.library", 0, -30) then
  14.     exit
  15. IF  ~SHOW('P','AMTALK')  THEN DO   /* Already there */
  16.            ADDRESS COMMAND 'run >nil: AmTalk '
  17.     address
  18.     waitforport amtalk
  19. end
  20.  
  21. if (user = "?"|user = "") then do
  22.     say "        talk.rexx"
  23.     say "  usage: talk user@hostname locate/s remotetty"
  24.     say "example: talk mrfitz@groupz.net ttyp0"
  25.     say ""
  26.     say "If the user has an alias in the AmTalk userlist"
  27.     say "then you can use just the alias on the command line"
  28.     say ""
  29.     say "example: talk mike"
  30.     say ""
  31.     say "If the alias has a dynamic address in the userlist,"
  32.     say "(ie: mrfitz@ags-r3-p5.groupz.net) then you can use"
  33.     say " the alias, the address and the locate switch to call."
  34.     say ""
  35.     say "example: talk mike l" 
  36.     exit
  37. end
  38.  
  39. if host = "" then do
  40.     address amtalk
  41.     findalias user
  42.     alias=result
  43.     parse var alias user '@' host
  44.     if user = "RESULT" then do
  45.         say "Alias was not found in the userlist."
  46.         say "  usage: talk user@hostname locate/s remotetty"
  47.         say "example: talk mrfitz@groupz.net"
  48.         say "     or: talk mrfitz (using alias)"
  49.         exit
  50.     end
  51.     if upper(left(locate,1))="L" then locate="locate"
  52.     address amtalk
  53.     talk user host locate remotetty
  54.     exit
  55. end
  56.  
  57. address amtalk
  58. findalias user
  59. alias=result
  60. parse var alias luser '@' ghost
  61. if luser = "RESULT" then do
  62.     if upper(left(locate,1))="L" then locate="locate"
  63.     address amtalk
  64.     talk user host locate remotetty
  65.     exit
  66. end
  67. else do
  68.     if upper(left(locate,1))="L" then locate="locate"
  69.     address amtalk
  70.     talk luser ghost locate remotetty
  71.     exit
  72. end
  73.  
  74.     
  75.